<extend name="Public:common" />
<block name="body">
  <div class="pure-u-11-13">
        <div class="index-content-top">     
            <div class="conten-issue">
                <div class="form-box">
                    <form action="__SELF__" method="post">
                        <input type="text" name="username" />
                        <select name="usertype" class="form-select">
                            <option value="-1">请选择用户类型</option>
                            <option value="0">模特</option>
                            <option value="1">卖家</option>
                        </select>
                        <input type="submit" value="搜索"/>
                    </form>
                </div>
            </div>
        </div>
    <table border="1" cellspacing="" cellpadding="" class="index-content-table index-table-head" width="100%">
        <tr>
          <td>ID</td>
          <td>用户名</td>
          <td>用户类型</td>
          <td>添加时间</td>
          <td>操作</td>
        </tr>
     <volist name="list" id="vo">
        <tr>
            <td>{$vo.id}</td>
            <td>{$vo.username}</td>
            <td>{$vo['usertype']==1?'卖家':'模特'}</td>
            <td>{$vo.reg_time| date="Y-m-d H:i:s", ###}</td>
            <td>
                <a href="{:U('Admin/User/delUser',array('id'=>$vo['id'],'usertype'=>$vo['usertype']))}" class="index-amend ">删除</a>       
                <!--<a href="{:U('Admin/User/editmodel',array('uid'=>$vo['id']))}" class="index-amend ">编辑</a>-->
                <if condition='$vo.status neq 1'>
                    <a class="checkyes index-amend" id="{$vo.id}">审核</a>
                <else />
                    <a class="checkno index-amend" >审核已通过</a>
                </if>
            </td>
        </tr>
  </volist>
    </table>
 <div class="index-paging">
     {$show_page}
   </div>
  </div>
</block>
<block name='script'>
    <script type="text/javascript">
        //审核模特
        $(function(){
            //审核通过
            $('.checkyes').click(function(){
                var id = $(this).attr('id');
                var pass = $(this);
                $.post(
                    "{:U('Admin/Model/checkModel')}",
                    {uid:id, status:1},
                    function(data){
                        if(data.code == 1){                        
                            pass.html('审核已通过');
                        }
                    }
                );
            });
        });
    </script>
</block>